<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style13/Level3outlineStyle2Bg.webp'" alt="" />
      <div class="outline">
        <div
          class="outline-title"
          v-if="(props.info.value || props.info.subTitle || props.info.remarks) && props.info.text.length > 10"
          :class="!props.info.value && !props.info.subTitle && 'outline-margin'"
          v-html="textType(props.info.text)"
        ></div>
        <div class="outline-title3" v-else-if="props.info.value || props.info.subTitle || props.info.remarks">
          <p>{{ props.info.text }}</p>
        </div>
        <div class="outline-title2" v-if="!props.info.value && !props.info.subTitle && !props.info.remarks">
          <p>{{ props.info.text }}</p>
        </div>
        <p class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        <div class="outline-cover" v-if="props.info.value" @click="ImgVisible = true">
          <img :src="urls + props.info.value + '?imageView2/3/w/898/h/460/format/webp'" alt="" />
        </div>
        <TextMax
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :infoData="props.info"
          :row="
            props.info.value && props.info.subTitle
              ? 2
              : !props.info.value && props.info.subTitle
              ? 7
              : props.info.value && !props.info.subTitle
              ? 4
              : 7
          "
        ></TextMax>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style2/firstLevelOutline1Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free13Style2',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style13.vue';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
}
.shadow {
  width: 640px;
  height: 200px;
  position: absolute;
  bottom: 0;
  left: 0;
}
.flex-box {
  width: 462px;
  height: 684px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 60px 94px 204px 94px;
  z-index: 20;
}
.Showroom-parent {
  position: absolute;
  top: 58px;
  right: 20px;
  z-index: 23;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  z-index: 22;
}
.outline-margin {
  margin-bottom: 48px !important;
}
.outline-title3 {
  width: 100%;
  margin-bottom: 24px;
  ::v-deep p {
    font-size: 22px;
    color: #333333;
    line-height: 34px;
    text-align: center;
    font-family: SourceHanSerifCN-Bold;
  }
}
.outline-title2 {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  ::v-deep p {
    font-size: 22px;
    color: #333333;
    line-height: 26px;
    text-align: center;
    font-family: SourceHanSerifCN-Bold;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
  }
}
.outline-title {
  width: 100%;
  margin-bottom: 24px;
  ::v-deep p {
    font-size: 22px;
    color: #333333;
    line-height: 34px;
    text-align: center;
    font-family: SourceHanSerifCN-Bold;
  }
}
.outline-subTitle {
  width: 100%;
  font-family: SourceHanSerifCN;
  font-size: 18px;
  color: rgba(0, 0, 0, 0.8);
  line-height: 28px;
  margin-bottom: 24px;
  text-align: center;
}
.outline-cover {
  width: 100%;
  height: 100%;
  background: #c4c4c4;
  margin-bottom: 24px;
  overflow: hidden;
  &:hover img {
    transform: scale(1.5);
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}
// ::v-deep .textMore-box {
//   margin-bottom: 16px;
// }
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.6) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ff0505 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>